#ifndef PRINTTASK_H
#define PRINTTASK_H

#include <QObject>
#include <QRunnable>
#include <QDebug>
#include <QThread>

class PrintTask : public QObject, public QRunnable
{
    Q_OBJECT
public:
    PrintTask() {}
    virtual ~PrintTask() {}

protected:
    void run()
    {
        // 线程执行的内容
        qDebug() << "PrintTask run 被调用，调用线程ID为：" << QThread::currentThread();
    }

signals:
    //注意！要使用信号，采用QObejct 和 QRunnable多继承，记得QObject要放在前面
    void mySignal();
};

#endif // PRINTTASK_H
